package com.mng.FactoryBeanTest;

import com.mng.beanTest2.Dept;
import com.mng.beanTest2.Emp;
import org.springframework.beans.factory.FactoryBean;

public class EmpFactory implements FactoryBean {
  @Override
  public boolean isSingleton() {
    return false;
  }

  @Override
  public Emp getObject() throws Exception {
    Emp emp = new Emp();
    emp.setName("FactoryBeanTest");
    Dept dept = new Dept();
    dept.setName("指挥部");
    emp.setDept(dept);
    return emp;
  }

  @Override
  public Class<?> getObjectType() {
    return null;
  }
}
